Graphical rendering of abstract shapes may require substantial processing of shape description data. Known methods for processing shapes may be found, for example, in the Java 2D API, which provides software tools for processing two dimensional vector graphics. However, there remains a need for a shape processing engine that reduces computational complexity to conserve processing resources, particularly in embedded systems that include display devices.
The shape processor is a rendering module that may be used to stream graphical objects having a predefined format into a frame buffer or a physical display. Documents to be rendered by the shape processor may be decomposed into primitive graphical objects and passed to the shape processor, which may in turn compose the objects for display. The shape processor advantageously processes each object as grayscale values until pixel data for the object is output to a display or frame buffer.
A system for processing graphical objects may include an input mechanism for receiving a stream of objects, each object having a set of parameters that define an image; and an object processor that processes the stream of objects on an object by object basis to create a pixel array.
One of the set of parameters may be a path, the object processor processing the path to create a pixel array representative of an outline of the image. The object processor may anti-alias the edges of the path. The object processor may run-length encode the outline of the image. One of the set of parameters may be a bounding box, the bounding box indicating to the object processor an area into which the object is to be rendered. The object processor may receive a smoothness factor, the smoothness factor specifying an amount of over-sampling of the object relative to the pixel array. One of the set of parameters may be a transparency, the transparency including a transparency value or a pointer to a bitmap of transparency values for the shape.
One of the set of parameters may be a fill, the fill including at least one of a color, a texture, or a bitmap. The anti-aliased edges may be represented as grayscale values. A tone response curve may be applied to the grayscale values of the anti-aliased edges. The pixel array may be transmitted to at least one of a screen, a printer, a network port, or a file. One of the parameters may be pre-processed shape data. The pre-processed shape data may include a clip mask. The pre-processed shape data may include a transparency. The pre-processed shape data may include a fill. The method may further include storing intermediate processing data in a cache, the intermediate processing data including at least one of a clip mask, a fill, or a transparency.
A method for image rendering described herein may include receiving an object to be displayed, the object including a shape and a fill; converting the shape of the object into a plurality of lines of encoded scan data having one of at least two possible states for pixels of a display including a first state and a second state, the first state representing a pixel inside the shape and the second state representing a pixel outside the shape; and blending each of the plurality of lines of encoded scan data and the fill into a line of a frame for the display.
The encoded scan data may include a third possible state for a pixel of a display representing a portion of a pixel inside the shape. The shape may include a path including a plurality of segments. The method may include converting one or more of the plurality of segments of the path that may be curved into a plurality of non-curved segments. The frame may include at least one of a video memory or a display device. The frame may correspond to at least one of a non-video memory or an output bitmap format buffer. The shape may include a clip mask of encoded scan data. A value for the third possible state may be calculated for a pixel by dividing the pixel into a plurality of sub-pixel regions, determining which ones of the plurality of sub-pixel regions are inside the shape, and determining a ratio of the ones of the plurality of sub-pixel regions inside the shape to the plurality of sub-pixel regions. The value may be represented as a grayscale value.
The object to be displayed may include a transparency and blending may further include blending each of the plurality of lines of encoded scan data and the transparency into a line of a frame for the display. The object to be displayed may include a transparency, the transparency being pre-processed according to at least one of a bit-depth correction, a tone correction, a scaling, a decompression, or a decoding. The transparency may include a pointer to a bitmap of transparency values for the shape. The fill may include at least one of a color, a texture, or a bitmap. The method may include storing the plurality of lines of encoded scan data as a clip mask in a cache. The method may include indexing the clip mask according to the shape.
A method for achromatically anti-aliasing the edges of a rendered color image as described herein may include receiving an object to be displayed, the object including a shape and a fill, the fill including one or more colors; representing a pixel of a display as a sub-pixel matrix, the sub-pixel matrix including one or more sub-pixel regions covering the pixel; intersecting the shape with the sub-pixel matrix; and converting the sub-pixel matrix to a grayscale value for the pixel.
The method may include blending the grayscale value for the pixel and the fill corresponding to the pixel with a previous value for the pixel. The method may include repeating receiving an object, representing a pixel, intersecting the shape, converting the sub-pixel matrix, and blending for a scan line of pixels. The method may include run-length encoding the grayscale values for the scan line of pixels. One or more dimensions of the sub-pixel matrix may be controlled by a smoothness value.
A method for smoothing an edge of a graphical object as described herein may include receiving an object to be displayed, the object including a path that outlines the object, the path having an inside and an outside; for each one of a plurality of pixels that intersect the path, over-sampling the one of the pixels to obtain a grayscale value representative of a portion of the one of the pixels that may be inside the path; and blending the plurality of pixels with data stored in a pixel array.
The method may include, for each one of the plurality of pixels, weighting a fill value for the pixel according to the grayscale value and de-weighting the data stored in the video memory according to the grayscale value. The method may include, for each one of the plurality of pixels, weighting a fill value for the pixel according to a transparency value and de-weighting the data stored in the pixel array according to the transparency value.
A system for processing graphical objects as described herein may include receiving means for receiving an object to be displayed, the object including a shape, a fill, and an alpha; converting means for converting the shape of the object into encoded scan data having one of at least two possible states for pixels including a first state and a second state, the first state representing a pixel inside the shape and the second state representing a pixel outside the shape; and blending means for blending the encoded scan data, the fill, and the alpha, into a line of a frame.
The encoded scan data may have a third possible state, the third possible state including a grayscale value representing a pixel that may be on an edge of the shape, the grayscale value corresponding to a portion of the pixel that may be inside the shape. The frame may correspond to at least one of a display, a printer, a file, or a network port. The object may include at least one of a background fill or a replacement fill, the blending means blending the at least one of the background fill or the replacement fill into a line of a frame.
A computer program for processing graphical objects as described herein may include computer executable code to receive an object to be displayed, the object including a shape, a fill, and an alpha; computer executable code to convert the shape of the object into encoded scan data having one of at least two possible states for pixels of a pixel array including a first state and a second state, the first state representing a pixel inside the shape and the second state representing a pixel outside the shape; and computer executable code to blend the encoded scan data, the fill, and the alpha, into a line of a frame of the pixel array.
The pixel array may correspond to at least one of a display, a printer, a file, or a network port. The encoded scan data may have a third possible state, the third possible state including a grayscale value representing a pixel that may be on an edge of the shape, the grayscale value corresponding to a portion of the pixel that may be inside the shape.
A system for processing graphical objects as described herein may include a processor, the processor configured to receive a graphical object that may include a shape, a fill, and a transparency, to convert the shape of the graphical object into encoded scan data that corresponds to inside pixels, outside pixels, and transition pixels for a scan line of a display, each transition pixel including a grayscale value corresponding to a portion of the pixel within the shape, and to combine the encoded scan data, the fill, and the alpha with a line of pixel data; and a memory that stores the line of pixel data, the memory adapted to provide the line of pixel data to the processor, and the memory adapted to store a new line of pixel data that may be generated when the line of pixel data may be combined with the encoded scan data, the fill, and the transparency.
The system may include a display configured to display the memory. The processor may be one or more of a microprocessor, a microcontroller, an embedded microcontroller, a programmable digital signal processor, an application specific integrated circuit, a programmable gate array, or programmable array logic. The system may be at least one of a printer configured to print the lines of pixel data stored in the memory, a storage device configured to store the lines of pixel data stored in the memory, a network device configured to output the lines of pixel data stored in the memory. The processor may be at least one of a chip, a chipset, or a die. The processor and the memory may be at least one of a chip, a chipset, or a die. The display may be a display of at least one of an electronic organizer, a palm-top computer, a hand-held gaming device, a web-enabled cellular phone, a personal digital assistant, an enhanced telephone, a thin network client, or a set-top box.
The display may be at least one of a printer or a plotter. The display may be used in a document management system. The display may be used in at least one of a facsimile machine, a photocopier, or a printer of a document management system. The display may be used in an in-car system. The display may be used in at least one of an audio player, a microwave, a refrigerator, a washing machine, a clothing dryer, an oven, or a dishwasher. The processor may receive a plurality of graphical objects and processes the plurality of graphical objects in parallel.